﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PhotoGallery.BLL;
using PhotoGallery.Model;
public partial class myfavorphoto : System.Web.UI.Page
{
    protected string uid = "";
    protected string pic_init = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["user"] != null)
        {
            uid = ((User)Session["user"]).Uid;
            CommentAction ca = new CommentAction();
            List<Picture> piclist = ca.getmyfavor(uid);
            if (piclist != null)
            {
                foreach (Picture p in piclist)
                {
                    pic_init += "<div class='box showpic'><div class='picbox'><a href='photo.aspx?pid=" + p.Id + "' target='_blank'><img height='150' width='150' alt=" + p.Desp + " class='txpic' src=" + p.Pic + " style='display: block;'></a></div><p>" + p.Desp + "</p><div class='actions'><div class='lefter'><a class='button white' href='photo.aspx?pid=" + p.Id + "'>评论</a></div><div class='righter'><a class='button white' href='#'>收藏</a><a class='button white' href='#'>分享</a></div></div></div>";
                }
            }
            else 
            {
                pic_init = "暂无收藏";
                
            }
        }
        else
            Response.Redirect("login.aspx");

    }
}